package com.myapi.ModelPoker;
import java.util.*;



/**
 * FullHands are high card, straight, flush, straight flush
 * @author Realease by Yoan Olivier
 *
 */
public class FullHand extends RankedHand implements Comparable {
	
	public FullHand(int rank, Set<Card> cards) {
		super(rank, cards);		
	}
        
        public String rankToString() {
            String outRank = "";
            switch(getRank()) {
                case 0: outRank = "High card"; break;
                case 4: outRank = "Straight"; break;
                case 5: outRank = "Flush"; break;
                case 8: outRank = "Straight flush"; break;
            }
            return outRank;
        }
	
	public int compareTo(Object o) {
		assert o instanceof RankedHand;
		RankedHand hand = (RankedHand) o;
		int handRank = hand.getRank();
		if(getRank() > handRank) {
			return 1;
		} else if(getRank() < handRank) {
			return -1;
		} else {
			return compareHighCards(getCards(), hand.getCards());
		}
	}

}
